<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thylemeaf.org">
<head>
    <meta charset="UTF-8">
    <title>有个名字叫智能汽车</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>

<!--    <script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>-->
<!--    <script type="text/javascript" src="js/bootstrap.min.js"></script>-->
<!--    <link href="css/indexyanshi.css" rel="stylesheet"/>-->
<!--    <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>-->


    <link rel="stylesheet" href="res/layui/css/layui.css">
    <link rel="stylesheet" href="res/static/css/index.css">
    <link href="css/bootstrap.min.css" rel="stylesheet"/>
    <link href="css/indexyanshi.css" rel="stylesheet"/>
    <script src="js/jquery-3.4.1.js"></script>
    <script type="text/javascript" src="js/bootstrap.min.js"></script>

    <style type="text/css">
        .bg {
            background-color: #f8cb43;
        }

        .top {
            font-size: 22px;
        }

        .space {
            padding-top: 30px;
        }
    </style>
    <script type="text/javascript">

        $(function () {

            var user;

            $("#dialog").click(function(){

                $.post("user/findUser",{},function(data){
                    if(data.phone==null){
                        window.location.href = "login.html";
                    }else{
                        user = data;
                    }
                });

            })

            $("#send").click(function () {

                var send = {userId:user.id,title:$("#title-text").val(),message: $("#message-text").val()};

                $.ajax({
                    url:'sugest/message',
                    contentType:'application/json;charset=UTF-8',
                    data:JSON.stringify(send),
                    type:'post',
                    dataType:'json',
                    success:function(data){
                        if (data == 1) {
                            alert("感谢您的反馈。")
                        } else {
                            alert("出现错误，反馈未能发出！")
                        }
                    }
                })

            })

        })

    </script>
</head>
<body>


<div th:replace="header::#nav_2"></div>

<br>
<br>
<br>
<br>
<div class="container space">
    <div class="row">

        <div class="jumbotron">
            <h1>告诉我们您的心声</h1>
            <p>给您带来优越享受！</p>
            <p>
                <button type="button" class="btn btn-primary" id="dialog" data-toggle="modal"
                        data-target="#exampleModal">您的宝贵意见
                </button>
            </p>
        </div>


        <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog"
             aria-labelledby="exampleModalLabel">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"
                                aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                        <h4 class="modal-title" id="exampleModalLabel">建议</h4>
                    </div>
                    <div class="modal-body">
                        <form>
                            <div class="form-group">
                                <label for="message-text" class="control-label">标题:</label>
                                <input class="form-control" id="title-text"></input>
                            </div>
                            <div class="form-group">
                                <label for="message-text" class="control-label">您的建议:</label>
                                <textarea class="form-control" id="message-text"></textarea>
                            </div>
                        </form>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default"
                                data-dismiss="modal">关闭
                        </button>
                        <button type="button" id="send" class="btn btn-primary" data-dismiss="modal">发送</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="container space">
    <div class="list-group">
        <a href="#" class="list-group-item active">常见问题</a> <a href="#"
                                                               class="list-group-item">忘记账号密码</a> <a href="#"
                                                                                                     class="list-group-item">怎么查看交易进度</a>
        <a href="#"
           class="list-group-item">如何以旧换新？具体要求</a> <a href="#"
                                                      class="list-group-item">废车如何回收？如何处理</a>
    </div>
</div>
<div class="container space">

    <h3>
        问题没解决？ <span class="label label-default">以下渠道</span>
    </h3>
</div>
<div class="container">
    <div class="row">
        <div class="col-xs-3 col-md-3">
            <a href="#" class="thumbnail"> <img src="img/human.jpg"
                                                alt="...">
            </a>
        </div>
        <div class="col-xs-3 col-md-3">
            <a href="#" class="thumbnail"> <img src="img/tel.jpg" alt="...">
            </a>
        </div>
        <div class="col-xs-3 col-md-3">
            <a href="#" class="thumbnail"> <img src="img/internet.jpg"
                                                alt="...">
            </a>
        </div>
        <div class="col-xs-3 col-md-3">
            <a href="#" class="thumbnail"> <img src="img/cooperation.jpg"
                                                alt="...">
            </a>
        </div>
    </div>
</div>

<footer class="container-fluid"
        style="width: 100%; height: 100px; background: #122B40;"></footer>
</body>
</html>
